Skip to content

Update flatpak, metainfo, snapcraft for 0.8.1 #3390

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

carstene1ns
Copy link
Member

No description provided.

@Ghabry
Copy link
Member

Ghabry commented Apr 8, 2025

@lotharsm are you still maintaining the easyrpg-player snap package? We want to update the file but are a bit stuck as nobody of us uses Ubuntu (and looks like various stuff is broken by now in the snap file e.g. it fails with CXXFLAGS unbound variable and also hates the git fetch in override-build (not a git repository)


Working snap file but I removed lots of the extra stuff as no idea how to fix this 😅

Removed all that build-override magic and just only build the 0.8.1 tags. These custom CXXFLAGS also do not work anymore, fail with "unbound variable". So assuming we would maintain this simplify everything as I have no idea why and how that works. Too much YAML magic in modern technology.

Here some changes that make it work for me:

diff --git a/builds/snap/snapcraft.yaml b/builds/snap/snapcraft.yaml
index ae3c6be64..371b18fef 100644
--- a/builds/snap/snapcraft.yaml
+++ b/builds/snap/snapcraft.yaml
@@ -1,4 +1,5 @@
 name: easyrpg-player
+version: '0.8.1'
 base: core22
 adopt-info: easyrpg-player
 summary: easyrpg-player
@@ -37,20 +38,14 @@ parts:
   liblcf:
     plugin: cmake
     source: https://github.com/EasyRPG/liblcf
+    source-tag: 0.8.1
     source-type: git
-    build-environment:
-      - CXXFLAGS: "$CXXFLAGS -fuse-ld=gold -flto=$(nproc) -ffunction-sections -fdata-sections"
-      - LDFLAGS:  "$LDFLAGS  -fuse-ld=gold -flto=$(nproc) -Wl,--gc-sections"
     cmake-parameters:
       - -DCMAKE_BUILD_TYPE=Release
       - -DCMAKE_INSTALL_PREFIX=/usr
       - -DBUILD_SHARED_LIBS=ON
       - -DLIBLCF_ENABLE_TOOLS=OFF
       - -DLIBLCF_UPDATE_MIMEDB=OFF
-    override-build: |
-      git fetch
-      snapcraftctl build
-      strip --strip-all $SNAPCRAFT_PART_INSTALL/usr/lib/liblcf.so.0.0.0
     build-packages:
       - libexpat1-dev
       - libicu-dev
@@ -58,37 +53,24 @@ parts:
       - icu-devtools
     stage-packages:
       - libicu70
+      - libinih1

   easyrpg-player:
     plugin: cmake
     after: [libwildmidi,liblcf,desktop-glib-only]
     source: https://github.com/EasyRPG/Player
+    source-tag: 0.8.1
     source-type: git
-    build-environment:
-      - CXXFLAGS: "$CXXFLAGS -fuse-ld=gold -flto=$(nproc) -ffunction-sections -fdata-sections"
-      - LDFLAGS:  "$LDFLAGS  -fuse-ld=gold -flto=$(nproc) -Wl,--gc-sections"
     cmake-parameters:
       - -DCMAKE_BUILD_TYPE=Release
+      - -DCMAKE_PREFIX_PATH=${SNAPCRAFT_STAGE}/usr
       - -DCMAKE_INSTALL_PREFIX=/usr
-    override-build: |
-      last_committed_tag="$(git tag --list | tail -n1)"
-      last_released_tag="$(snap info easyrpg-player | awk '$1 == "latest/beta:" { print $2 }')"
-      # If the latest tag from the upstream project has not been released to
-      # beta, build that tag instead of master.
-      if [ "${last_committed_tag}" != "${last_released_tag}" ]; then
-        git fetch
-        git checkout -f "${last_committed_tag}"
-        snapcraftctl set-version $(git -C ../src tag --list | tail -n1)
-      else
-        snapcraftctl set-version $(git describe | sed 's/desc\///')
-      fi
-      snapcraftctl build
-      strip --strip-all $SNAPCRAFT_PART_INSTALL/usr/bin/easyrpg-player
-
     build-packages:
+      - libfluidsynth-dev
       - libfmt-dev
       - libfreetype6-dev
       - libharfbuzz-dev
+      - liblhasa-dev
       - libmpg123-dev
       - libopusfile-dev
       - libpixman-1-dev
@@ -98,15 +80,17 @@ parts:
       - libspeexdsp-dev
       - libvorbis-dev
       - libxmp-dev
-
     stage-packages:
       - freepats
+      - libfluidsynth3
+      - libfmt8
       - libfreetype6
       - libharfbuzz0b
       - libmpg123-0
       - libgl1-mesa-dri
       - libgl1-mesa-glx
       - libglu1-mesa
+      - liblhasa0
       - libopusfile0
       - libpixman-1-0
       - libpng16-16
@@ -114,6 +98,7 @@ parts:
       - libsndfile1
       - libspeexdsp1
       - libvorbis0a
+      - libvorbisfile3
       - libwayland-egl1-mesa
       - libwildmidi-config
       - libxmp4
@@ -121,10 +106,8 @@ parts:
   libwildmidi:
     plugin: cmake
     source: https://github.com/Mindwerks/wildmidi
+    source-tag: wildmidi-0.4.6
     source-type: git
-    build-environment:
-      - CXXFLAGS: "$CXXFLAGS -fuse-ld=gold -flto=$(nproc) -ffunction-sections -fdata-sections"
-      - LDFLAGS:  "$LDFLAGS  -fuse-ld=gold -flto=$(nproc) -Wl,--gc-sections"
     cmake-parameters:
       - -DCMAKE_BUILD_TYPE=Release
       - -DBUILD_SHARED_LIBS=ON

@lotharsm
Copy link
Contributor

lotharsm commented Apr 8, 2025

I am not working on it right now, I'll try to find some time to look into it. The broken CXXFLAGS could be an incompatility with modern GCC versions, I need to revisit it.

@carstene1ns
Copy link
Member Author

@Ghabry the git and tag stuff should only be needed for the stable upload, same like I did for flatpak (on flathub).
In the repo we should keep the "rolling" version.

@lotharsm
Copy link
Contributor

The git stuff is meant for the continuous integration when building via snapcraft.io. It basically checks if the current stable build is the latest tag, and if there are newer commits, then it will build these instead. This allows that after releasing a new tag, you'll have the tagged build in edge and you can promote it to stable though the Snapcraft interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants